home *** CD-ROM | disk | FTP | other *** search
- '********************************************************************
- '
- ' This script calls MSI HQ BBS and uploads and downloads mail using
- ' the Tomcat mail door online.
- '
- '********************************************************************
-
- ' Set up a when on "-Pause-" to take care of the case where the sysop has
- ' a prelog screen with a pause in it.
-
- when match "-Pause-" do send
-
- ' Wait for name and password prompts and send the correct responses.
-
- waitfor "first name"
- send lastconnectuserid
- waitfor "password"
- send lastconnectpassword
-
- ' Set up a number of match type whens to provide answers to various prompts
- ' and so on.
-
- when match "] to continue" do send
- when match "view the bulletin menu" do send "N"
- when match "have new personal mail" do send "C"
- when match "protocol menu [" do send "Z"
-
- ' A when quiet is used to press Enter whenever we don't get any characters
- ' for a particular amount of time (10 seconds in this case)
-
- when quiet 10 do send
-
- ' Set the default timeout to 60 seconds - if we don't get what we're looking
- ' for then just abort (below in the "catch err_timeout" section)
-
- timeout 60
-
- ' Make our way to the Tomcat main menu
-
- waitfor "command"
- send "M"
- waitfor "command"
- send "T"
- waitfor "tomcat menu ["
-
- ' Now we're at the Tomcat main menu. Check to see if we have a REP file
- ' to upload. If so, go ahead and send it up.
-
- if exists(ConfigUploadPath+"\mustang.rep") then
- send "U"
- waitfor "now"
- if upload(ConfigUploadPath+"\mustang.rep", Zmodem) = 0 then
- del ConfigUploadPath+"\mustang.rep"
- end if
- waitfor "tomcat menu ["
- end if
-
- ' Now download the new mail. We will provide a timeout of 200 seconds
- ' on the 'waitfor' that waits for the prompt at the end of the scan,
- ' that way if this takes a long time we won't just abort.
-
- send "D"
- waitfor "would you like", 200
-
- ' Respond to the download prompt and download the file
-
- send "Y"
- waitfor "now", 120
- del ConfigDownloadPath+"\mustang.qwk"
- call download(ConfigDownloadPath, Zmodem)
-
- ' Wait for Tomcat to return to its menu and send the command to log off.
-
- waitfor "tomcat menu ["
- send "G"
-
- ' At this point the script will end and return to terminal mode.
-
- end
-
- ' This is a catch clause for the main program body, it handles timeout
- ' errors that are not otherwise handled. If we get a timeout here, then
- ' there's not much we can do so we just hang up and abort.
-
- catch err_timeout
- hangup
- end